/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package session;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import model.Position;

/**
 *
 * @author HuyNVK
 */
@Stateless
public class PositionFacade extends AbstractFacade<Position> implements PositionFacadeRemote {
    @PersistenceContext(unitName = "ejb-servPU")
    private EntityManager em;

    protected EntityManager getEntityManager() {
        return em;
    }

    public PositionFacade() {
        super(Position.class);
    }

    @Override
    public Position merge(Position position) {
        return em.merge(position);
    }

    @Override
    public void deleteByID(String id) {
        Position position = find(id);
        position = em.merge(position);
        em.remove(position);
    }

    @Override
    public void insert(Position position) {
        em.persist(position);
    }
    
}
